package com.qf.hospital.exception;

import com.qf.hospital.enums.HospitalExceptionEnum;

/**
 * @author 何星宇
 * @version V1.0
 * @Date 2021/10/15 15:42
 */
public class HosptialException extends RuntimeException {

    private Integer code;

    public HosptialException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public HosptialException(HospitalExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
    }

    public HosptialException(HospitalExceptionEnum exceptionEnum, String msg) {
        super(exceptionEnum.getMsg()+"--"+msg);
        this.code = exceptionEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
